<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/common.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="title">
        Event edit
    </ui:define>

    <ui:define name="head">
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
         <link rel="stylesheet" href="../../res/css/jquery-ui.css" />
        <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
        <script type="text/javascript" src="../../ckeditor/ckeditor.js"></script>

        <script type="text/javascript">
            $(function() {
                $(".c1").datepicker({
                    dateFormat: 'dd-mm-yy',
                    changeMonth: true,
                    changeYear: true
                });
            });
        </script>
         <ui:define name="pageheader">
         <script>
            $(function() {
                $(document).tooltip();
            });
        </script>
        <style>
            label {
                display: inline-block;
                width: 100px;
            }
        </style>
          <link rel="stylesheet" href="../../res/css/admin-style.css"/>
        <script src="../../resources/js/jsDatePick.min.1.3.js" type="text/javascript" />
        <link id="theme_base" href="../../resources/css/pickadate/themes/default.css" rel="stylesheet" />
        <link id="theme_date" href="../../resources/css/pickadate//themes/default.date.css" rel="stylesheet" />
        <link id="theme_time" href="../../resources/css/pickadate//themes/default.time.css" rel="stylesheet" />
    </ui:define>

    <ui:define name="pageheader">
        Event edit
    </ui:define>

    <ui:define name="content">
        <h:form id="form" >
            <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
                <tr>
                    <th valign="top">Name:</th>
                    <!--<td><input type="text" class="inp-form-error" /></td>-->
                    <td>
                        <h:inputText required="true" value="#{eventManager.title}" styleClass="inp-form" alt="&lt;Event's title here&gt;"/>
                    </td>
                </tr>
                <tr>
                    <th valign="top">Start date</th>
                    <!--<td><input type="text" class="inp-form-error" /></td>-->
                    <td>
                        <h:inputText  id="dpBirth" value="#{eventManager.startDate}"  styleClass="inp-form c1"
                                      alt="&lt;Start Date here&gt;">
                            <f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="GMT+7"/>

                        </h:inputText>
                        <!--<t:inputCalendar />-->
                    </td>

                </tr>
                <tr>
                    <th valign="top">End date</th>
                    <td>
                        <h:inputText   value="#{eventManager.endDate}" styleClass="inp-form c1" alt="&lt;End Date here&gt;">
                            <f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="GMT+7"/>
                        </h:inputText>
                    </td>

                </tr>
                <tr>
                    <th valign="top">Content</th>
                    <td>
                        <h:inputTextarea id="textarea"  class="editor" value="#{eventManager.content}"  />
                        <script type="text/javascript">
                            //<![CDATA[
                            CKEDITOR.replace('form:textarea');
                            //]]>
                        </script>
                    </td>

                </tr>
                <tr>
                    <th>&nbsp;</th>
                    <td valign="top">
                        <h:commandButton value="Create" action="#{eventManager.doupdate()}" class="buttons"/>
                    </td>
                    <td></td>
                </tr>

            </table>
        </h:form>
    </ui:define>

</ui:composition>
